Skip to content

Show class that originally defined attribute in output#15230

Open
97littleleaf11 wants to merge 8 commits into
python:masterfrom
97littleleaf11:fix-2500
Open

Show class that originally defined attribute in output#15230
97littleleaf11 wants to merge 8 commits into
python:masterfrom
97littleleaf11:fix-2500

Conversation

@97littleleaf11

Copy link
Copy Markdown
Collaborator

Closes #2500
Previous PR: #6806

97littleleaf11 and others added 2 commits May 13, 2023 01:31
Co-authored-by: ucodery <ucodery@gmail.com>
@github-actions

This comment has been minimized.

97littleleaf11 and others added 2 commits May 13, 2023 04:22
Co-authored-by: ucodery <ucodery@gmail.com>
@github-actions

This comment has been minimized.

@97littleleaf11 97littleleaf11 changed the title [WIP] Show class that originally defined attribute in output Show class that originally defined attribute in output May 12, 2023
@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

comtypes (https://github.com/enthought/comtypes)
- comtypes/tools/typedesc_base.py:166: error: Incompatible types in assignment (expression has type "list[Field]", variable has type "list[Field | Method | Constructor]")  [assignment]
+ comtypes/tools/typedesc_base.py:166: error: Incompatible types in assignment (expression has type "list[Field]", base class "_Struct_Union_Base" defined the type as "list[Field | Method | Constructor]")  [assignment]
- comtypes/tools/typedesc_base.py:180: error: Incompatible types in assignment (expression has type "list[Field]", variable has type "list[Field | Method | Constructor]")  [assignment]
+ comtypes/tools/typedesc_base.py:180: error: Incompatible types in assignment (expression has type "list[Field]", base class "_Struct_Union_Base" defined the type as "list[Field | Method | Constructor]")  [assignment]

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", base class "type" of metaclass "ABCMeta" defined the type as "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "Callable[[Any, Any, VarArg(Any), KwArg(Any)], Any]", base class "type" of metaclass "ABCMeta" defined the type as "Callable[[_GeneratorContextManager[_T_co], Callable[..., Iterator[_T_co]], tuple[Any, ...], dict[str, Any]], None]")  [assignment]

@97littleleaf11 97littleleaf11 requested a review from JukkaL May 13, 2023 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For incompatible attribute assignment, show class that defines attribute

1 participant